package com.qingcheng;

import com.alibaba.fastjson.JSON;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageListener;

import java.util.Map;

public class SmsMessageConsumer implements MessageListener {

    @Override
    public void onMessage(Message message) {

        String string = new String(message.getBody());
        Map<String,String> map = JSON.parseObject(string, Map.class);
        String code = map.get("code");
        String phone = map.get("phone");
        System.out.println(code+":"+phone);
        //消费者收到验证码以及手机号码,用阿里云发短信到用户手机


    }
}
